package cmd

import (
	"gitee.com/mkwchecking/k-scaffold/apps/register"
	"gitee.com/mkwchecking/k-scaffold/cmd/server"
	"github.com/spf13/cobra"

	_ "gitee.com/mkwchecking/k-scaffold/apps/register/appref"
)

var rootCmd = &cobra.Command{
	Use:   "k-scaffold",
	Short: "A scaffold for kratos",
}

func init() {
	// 启动服务命令
	rootCmd.AddCommand(server.ServerCmd)

	// 注册应用内命令
	rootCmd.AddCommand(register.GetAppCommands()...)
}

func Execute() error {
	return rootCmd.Execute()
}
